#if defined(_MSC_VER)
#pragma once
#endif

#ifndef LM_SAMPLER_POISSONDISK_H
#define LM_SAMPLER_POISSONDISK_H

#include "../core/sampler.h"

/*
	Implementation of a Poisson Disk sampler using method described in paper
	"Fast Poisson Disk Sampling in Arbitrary Dimensions"
	by Robert Bridson http://www.cs.ubc.ca/~rbridson/
*/

class PDSampler : public Sampler
{
public:
	PDSampler(int xstart, int xend, int ystart, int yend, int spp, bool lns, bool ts);
	~PDSampler();
	int MaximumSampleCount() { return 1; }
	int RoundSize(int size) const { return size; };
	int GetMoreSamples(Sample *sample);
	Sampler *GetSubSampler(int num, int count);
private:
	int xPos, yPos;
	int samplePos;
	int nPixelSamples;

	float radius;			// radius for blue noise sampling
	vector<Vector2> image;	// vector to store image samples
	vector<Vector2> lens;	// vector to store lens samples
	vector<float> time;		// vector to store time samples

	RNG *rng;
};


#endif	// LM_SAMPLER_POISSONDISK_H